"""
# 1. ***********************************正则的使用*******************************
phone_pattern = r'^1[23456789]\d{9}$'
phone1 = '18829266582'
phone2 = '1882926658'
import re
re.search(phone_pattern, phone1)
<re.Match object; span=(0, 11), match='18829266582'>
result = re.search(phone_pattern, phone1)
result
<re.Match object; span=(0, 11), match='18829266582'>
result.string
'18829266582'
result = re.search(phone_pattern, phone2)
result
phone3 = '888888888888888888888888'
re.search(phone_pattern, phone3)
re.match(phone_pattern, phone1)
<re.Match object; span=(0, 11), match='18829266582'>
re.match(phone_pattern, phone2)
re.match(phone_pattern, phone3)
help(re.search)
Help on function search in module re:
search(pattern, string, flags=0)
    Scan through string looking for a match to the pattern, returning
    a Match object, or None if no match was found.
help(re.match)
Help on function match in module re:

# 2. ********************************************关于日期的处理******************************
from datetime import  datetime, date, time, timedelta
datetime.now()
datetime.datetime(2020, 3, 28, 11, 22, 28, 393811)
date.today()
datetime.date(2020, 3, 28)
td1 = timedelta(days=3)
today = date.today()
today - td1
datetime.date(2020, 3, 25)
today + td1
datetime.date(2020, 3, 31)
td2 = timedelta(seconds=3)
td2 = timedelta(hours=3)
now = datetime.now()
now
datetime.datetime(2020, 3, 28, 11, 25, 22, 71948)
now + td2
datetime.datetime(2020, 3, 28, 14, 25, 22, 71948)
now - td2
datetime.datetime(2020, 3, 28, 8, 25, 22, 71948)
"""